class AmmoLauncher:
	def __init__(self,speed,ammo_type):
		self.speed=speed
		self.ammo_type=ammo_type
	def attack(self,user):
		ammo_type=self.ammo_type
		ammo=ammo_type(x=user.x,y=user.y+user.getHeight()-40)
		l=user.look
		ll=(l[0]**2+l[1]**2)**0.5
		speed=self.speed#5800*1.0/24
		ammo.prev_x=ammo.x-speed*l[0]/ll
		ammo.prev_y=ammo.y-speed*l[1]/ll
		ammo.cur_room=user.cur_room
		ammo.fraction=user.fraction
		user.cur_room.projectilesList.append(ammo)